1. Field of the Invention
The present invention relates to a communication apparatus which performs wireless communication with a target apparatus, a computer-readable storage medium having stored therein a control program thereof, and a control method thereof. More particularly, the invention relates to a control process and a control method relating to establishment of a connection with the target apparatus.
2. Description of the Background Art
In recent years, communication using a wireless LAN such as the IEEE 802.11 standard has become widespread among terminals such as notebook PCs, hand-held game machines, and the like. Such communication requires a function of searching for another station such as an access point of a connection target, another terminal, or the like. Generally, a client terminal such as a notebook PC or a hand-held game machine has the same ESSID (Extended Service Set Identifier) as that of a connection target, and searches for a connection target station having the same ESSID by performing passive scan or active scan which are described in, for example, “802.11 High-SpeedWireless LAN Textbook (RevisedEdition)” edited by Masahiro Morikura and Shuji Kubota, Impress, December 2004, p. 105-106.
The passive scan is performed as follows. A client terminal monitors (searches for) a signal (beacon) transmitted from other stations, with respect to each frequency band (channel) used in a wireless LAN. This signal is broadcasted from each station at regular intervals, and includes an ESSID, and a BSSID (Basic Service Set Identifier) which is an identifier specific to a station. Usually, the BSSID is identical to a MAC address of a station. The client terminal having received this signal determines whether or not an ESSID set in the client terminal matches the ESSID included in the signal. When there is a match, the client terminal transmits a connection request with the BSSID included in the signal being a destination, by using the channel through which the client terminal received the signal, thereby establishing a connection with the station which transmitted the signal.
On the other hand, the active scan is performed as follows. A client terminal broadcasts, through each channel, a signal (probe request) including an ESSID set in the client terminal, and thereafter, waits for a response from another station in each channel. Each station having received the signal determines whether or not the ESSID included in the signal matches an ESSID set in the station. When there is a match, the station transmits a signal (probe response) including its own BSSID to the client terminal. The client terminal having received this signal transmits, using the channel through which the client terminal received the signal, a connection request with the BSSID included in the probe response as the destination, thereby establishing a connection with the station which transmitted the probe response.
In the aforementioned connection establishing methods, however, even when searching for a station is performed using either the passive scan or the active scan, the terminal requires a time for waiting for a signal from each station in each channel, and thus the terminal might take a lot of time to establish connection. For example, assuming that the client terminal waits for beacons or probe responses from other stations with respect to eleven channels, and requires a waiting time of at least 100 ms for each channel, the terminal requires about 1.1 sec until it completes the scan to obtain information required for connection. If a process such as a retry is included, more time is required. Such scanning method is useful when applied to a communication environment such as a public wireless LAN service in which different APs (access points) have the same ESSID but different BSSIDs and different communication channels. However, in a case where a terminal is always connected to the same access point installed at home (on a home network) or the like, the BSSID and the used channel of the connection target are not likely to be changed, and it is not likely to be necessary to scan all the eleven channels as described above. Therefore, for a user who usually connects a terminal to an access point installed at home, the aforementioned waiting time causes the user to feel stress.